package com.mt.api.modules.manager.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.mt.api.core.page.PageFactory;
import com.mt.api.modules.domain.Product;
import com.mt.api.modules.domain.bo.ProductStatPageBo;
import com.mt.api.modules.domain.dto.ProductStatByProductNoDto;
import com.mt.api.modules.domain.dto.ProductStatQtyByCargoDto;
import com.mt.api.modules.manager.IProductManager;
import com.mt.api.modules.mapper.ProductMapper;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * @Author: plover
 * @Date: 2022-05-06
 * @Description:
 */
@Component
public class ProductManagerImpl extends ServiceImpl<ProductMapper, Product> implements IProductManager {

    @Override
    public Page<ProductStatByProductNoDto> statByProductNo(ProductStatPageBo bo) {
        Page page = PageFactory.defaultPage(bo);
        page = baseMapper.statByProductNo(page, bo);
        return page;
    }

    @Override
    public List<ProductStatQtyByCargoDto> statQtyByCargo(List<Integer> cargoIdList) {
        return baseMapper.statQtyByCargo(cargoIdList);
    }
}
